<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<div class="left-sidebar">
    <!-- 用户信息 -->
    <div class="tpl-sidebar-user-panel">
        <div class="tpl-user-panel-slide-toggleable">


            <form target="avatarIframe" id="avatarForm" action="/user/uploadAvatar" method="post" enctype="multipart/form-data" >
                <div class="am-form-group am-form-file">
                    <div class="tpl-user-panel-profile-picture">
                        <img id="avatarImg" src="/user/showAvatar" alt="">
                    </div>

                    <input id="doc-form-file" type="file" name="avatar" onchange="uploadAvatar();" multiple="">
                </div>
            </form>


            <a href="javascript:;" target="_blank" class="tpl-user-panel-action-link"> <span class="am-icon-pencil"></span> 账号设置</a>
        </div>
    </div>

    <!-- 菜单 -->
    <ul class="sidebar-nav">

        <li class="sidebar-nav-link">
            <a id="home" href="/user/toHome">
                <i class="am-icon-home sidebar-nav-link-logo"></i> 首页
            </a>
        </li>
        <li class="sidebar-nav-link">
            <a id="openaccount" href="/user/toOpenaccount">
                <i class="am-icon-wpforms sidebar-nav-link-logo"></i> 开户
            </a>
        </li>
        <li class="sidebar-nav-link">
            <a id="draw" href="/user/toDraw">
                <i class="am-icon-wpforms sidebar-nav-link-logo"></i> 取款
            </a>
        </li>
        <li class="sidebar-nav-link">
            <a id="deposit" href="/user/toDeposit">
                <i class="am-icon-wpforms sidebar-nav-link-logo"></i> 存款

            </a>
        </li>
        <li class="sidebar-nav-link">
            <a id="transfer" href="/user/toTransfer">
                <i class="am-icon-wpforms sidebar-nav-link-logo"></i> 转账

            </a>
        </li>

        <li class="sidebar-nav-link">
            <a id="email" href="/userDetail/toEmail">
                <i class="am-icon-wpforms sidebar-nav-link-logo"></i> 邮箱

            </a>
        </li>

        <li class="sidebar-nav-link">
            <a id="flow" href="/user/toFlow">
                <i class="am-icon-bar-chart sidebar-nav-link-logo"></i> 流水

            </a>
        </li>

        <li class="sidebar-nav-link">
            <a id="resetPassword" href="/user/toResetPwd">
                <i class="am-icon-wpforms sidebar-nav-link-logo"></i> 重置密码

            </a>
        </li>

    </ul>
</div>

<%--内置在当前窗口的子窗口 和当前窗口是父子关系  子窗口可以访问父窗口的JS函数--%>
<iframe name="avatarIframe" style="display: none"></iframe>


<script>
    function uploadAvatar() {
        $('#avatarForm').submit();
    }

    function uploadCallBack() {
        $('#avatarImg').attr('src', '/user/showAvatar?k=' + new Date().getTime());
    }
</script>